import java.util.concurrent.*;

/**
 * @Author Stringzhua
 * @Date 2024/10/30 15:01
 * description:
 */
public class ThreadPool04 {
    public static void main(String[] args) {
        ThreadPoolExecutor poolExecutor = new ThreadPoolExecutor(
                10,
                10,
                20, TimeUnit.SECONDS,
//                new ArrayBlockingQueue<>(10),//底层是数组,必须指定大小
                new LinkedBlockingQueue<>(10),//底层是单向链表,不带参为无限大小,带参为有限大小 poll()出队 入队offer()
//                new PriorityBlockingQueue<>(10),//底层是数组,但是可以指定优先级
                Executors.defaultThreadFactory(),//线程工厂,线程池创建的线程都在线程工厂创建
               new ThreadPoolExecutor.AbortPolicy());
    }
}
